/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.com.jsepc.rep.demension;

import cn.com.jsepc.rep.comm.ConstUtil;
import com.jarp.db.DAO;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;

/**
 *
 * @author 赵远
 */
public class CheckLeaf {

    public Boolean isLeaf(String ID,  String parent_id_colum_name, String table_name) {
        try {
            /*
             * ID:值 
             * parent_id_colum_name 父级id字段名
             * table_name:表名
             */
            DAO dao=new DAO();
            String sql="SELECT * from "+table_name+" Where "+parent_id_colum_name+"="+ID;
            Vector v=dao.getDataSet(ConstUtil.DBNAME, sql);
            if(v==null)
                return true;
            else
                return false;
        } catch (ServletException ex) {
            Logger.getLogger(CheckLeaf.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }
    }
}
